<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // 1.如果改变length的值,length少了相等于删除,多了用undefined填充
    let nums = [1,3,5,7,9]
    nums.length = 2
    console.log(nums)  // [1,3]
    nums.length = 5
    console.log(nums) // [1,3,,,,]
</script>
</body>
</html>